package com.corpgovernment.organization.operatelog.service.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 出差申请管控方式
 */
public enum ManagementControlEnum {
    ONE("1","严格管控"),
    TWO("2","不严格管控"),
    THREE("3","不管控");


    /**
     * 描述
     */
    private String desc;
    /**
     * cocde
     */
    private String code;


    private ManagementControlEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<String, ManagementControlEnum> lookup = new HashMap<>();

    static {
        for (ManagementControlEnum s : EnumSet.allOf(ManagementControlEnum.class)) {
            lookup.put(s.getCode(), s);
        }
    }

    public String getDesc() {
        return desc;
    }

    public String getCode() {
        return code;
    }

    public static ManagementControlEnum get(String code) {
        return lookup.get(code);
    }
    public static boolean exists(String code) {
        return lookup.containsKey(code);
    }

}
